package com.share.admin.web;

import com.alibaba.fastjson.JSONObject;
import com.share.admin.service.IDictionaryService;
import com.share.common.common.Result;
import com.share.common.utils.SysUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CommonController {
    @Autowired
    private IDictionaryService dictionaryService;

    @RequestMapping("/common/serverInfo")
    public Result list() {
        JSONObject server = SysUtil.server();
        return Result.success(server);
    }

    @RequestMapping("/reload/dictionary")
    public Result reloadDictionary() {
        return Result.success(dictionaryService.init());
    }
}
